/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.connection.tcp;

import java.io.DataOutputStream;
import java.net.Socket;

import com.hercules.android.receiver.connection.tcp.TCPServerConnection.TCPConnectionHandler;

/**
 * Class that represent information about session via TCP protocol.
 * <p>
 * AndroidAssembly3 this class was added for Android Assembly 3
 *
 * @author 7realm
 * @version 1.0
 */
public class TCPSessionInfo {
    /** Represents the active socket of the session. */
    private Socket socket;
    /** Represents the socket output stream to send commands. */
    private DataOutputStream socketOutput;
    /** Represents the connection handler. */
    private TCPConnectionHandler handler;
    
    /**
     * Constructor for class TCPSessionInfo.
     *
     * @param socket the socket
     * @param socketOutput the socket output
     */
    public TCPSessionInfo(Socket socket, DataOutputStream socketOutput, TCPConnectionHandler handler) {
        this.socket = socket;
        this.socketOutput = socketOutput;
        this.handler = handler;
    }

    /**
     * Gets the active socket of the session.
     *
     * @return the active socket of the session
     */
    public Socket getSocket() {
        return socket;
    }

    /**
     * Sets the active socket of the session.
     *
     * @param socket the active socket of the session
     */
    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    /**
     * Gets the socket output stream to send commands.
     *
     * @return the socket output stream to send commands
     */
    public DataOutputStream getSocketOutput() {
        return socketOutput;
    }

    /**
     * Sets the socket output stream to send commands.
     *
     * @param socketOutput the socket output stream to send commands
     */
    public void setSocketOutput(DataOutputStream socketOutput) {
        this.socketOutput = socketOutput;
    }
    
    /**
     * Gets the connection handler.
     * 
     * @return the connection handler.
     */ 
    public TCPConnectionHandler getConnectionHandler() {
		return handler;
    }
}